package com.atguigu.controller;

import com.atguigu.service.OrderService;
import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {
    /**
     * 在Service使用Feigin的时候使用fallback
     */

    @Resource
    private OrderService orderService;


    @GetMapping("/consumer/error/{id}")
    public String payment_error(@PathVariable("id") Integer id){
        return orderService.payment_error(id);
    }

    @GetMapping("/consumer/ok")
    public String okk(){
        return orderService.ok();
    }

}
